
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:lcapp/config/const_config.dart';
import 'package:lcapp/page/min/min_cancle_account_page.dart';
import 'package:lcapp/widget/asr_app_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class Setting extends StatefulWidget {
  @override
  _SettingState createState() => _SettingState();
}

class _SettingState extends State<Setting> {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AsrAppBar(
        title: Text(
          '设置',
          style: TextStyle(
              fontSize: 34.sp,
              color: Color(0xFF333333),
              fontWeight: FontWeight.bold),
        ),
      ),
      body: Container(
        color: bgColor,
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.symmetric(horizontal: 40.w),
              decoration: BoxDecoration(
                color: Colors.white,
                boxShadow: [
                  BoxShadow(
                    color: Color(0x14999999),
                    offset: Offset(0.0, 3.0), //阴影xy轴偏移量
                    blurRadius: 12.0, //阴影模糊程度
                    spreadRadius: 1.0, //阴影扩散程度
                  )
                ],
              ),
              child: Column(
                children: [
                  //关于我们
                  GestureDetector(
                    onTap: () {
                      Navigator.pushNamed(context, "MinAboutMinPage");
                    },
                    child: Container(
                      height: 100.w,
                      child: Row(
                        children: [
                          Expanded(
                              child: Container(
                                child: Text(
                                  '关于我们',
                                  style: TextStyle(
                                    fontSize: 28.sp,
                                    color: Color(0xFF222222),
                                    fontWeight: FontWeight.w400,
                                  ),
                                ),
                              )),
                          Container(
                            child: Icon(
                              Icons.keyboard_arrow_right,
                              size: 50.w,
                              color: Color(0xFFE0E0E0),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: 1,
                    color: Color(0xffE9E8E9),
                  ),
                  //退出登录
                  Container(
                    height: 100.w,
                    child: Column(
                      children: [
                        Expanded(child: Row(
                          mainAxisAlignment: MainAxisAlignment.start,
                          children: [
                            Expanded(child: Text('注销账号',style: TextStyle(
                              color: Colors.black,
                              fontSize: 32.sp,
                            ),)),
                            GestureDetector(
                              onTap: (){
                                FocusScope.of(context).requestFocus(FocusNode());
                                SmartDialog.show(
                                  alignment: Alignment.center,
                                  clickMaskDismiss: false,
                                  maskColor: Color.fromRGBO(0, 0, 0, 0.75), builder: (BuildContext context) {
                                    return CancleAccountPage(arguments:{
                                      'url':cancleURL
                                    });
                                },
                                  );
                              },
                              child: Container(
                                padding: EdgeInsets.symmetric(vertical: 6.w,horizontal: 16.w),
                                decoration: BoxDecoration(
                                    color: defaultBarColor,
                                    borderRadius: BorderRadius.circular(20.w)
                                ),
                                margin: EdgeInsets.only(left: 20.w,right: 6.w),
                                child: Text('申请注销',
                                  textAlign: TextAlign.right,
                                  style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 28.sp,
                                  ),),
                              ),
                            )
                          ],
                        )),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
